How much slower is a try/catch block? [closed]

Posted by Euclid on Stack Overflow See other posts from Stack Overflow or by Euclid
Published on 2009-12-11T01:13:57Z Indexed on 2010/03/12 3:37 UTC
Read the original article Hit count: 111

Filed under:
|
|

Possible Duplicate:
What is the real overhead of try/catch in C#?

how much slower is a try catch block than a conditional? eg

try
{
    v = someArray[10];
}
catch 
{
    v = defaultValue;
}

or

if (null != someArray)
{
    v = someArray[10];
}
else
{
    v = defaultValue;
}

is there much in it or isn't there a definative performance differance?

© Stack Overflow or respective owner

Related posts about c#

Related posts about Performance